1. Field of the Invention
The present invention relates to a file system suitable for use in recording a data sequence as a file in a recording medium such as a magnetic storage device.
2. Description of the Related Art
Random access media, such as magnetic discs and magneto-optical discs, have nowadays been taking the place of sequential access media, such as videotapes, which had ever been commonly used as a recording medium for picture data.
These random access media, compared to the sequential access media, have an advantage of giving free data accessing. In an effort to make a better use of such random access media, applications have been studied to perform various kinds of processing, such as simultaneous recording of plural pictures, time-shift replay, immediate replay from a desired position, and simultaneous processing of different types of editing.
In the random access media, a file system stores/manages a data sequence of picture information in files. There has been known a commonly used file system (hereinafter, also called xe2x80x9cFAT file systemxe2x80x9d) utilizing a file allocation table (FAT), which file system is used chiefly in operation systems, such as MS-DOS or MS-Windows (trademarks of Microsoft Corporation) of personal computers (PC).
The FAT file system will now be described with reference to FIGS. 2 and 16. FIG. 2 shows hardware of a host computer which the file system is applied to. FIG. 16 shows a conventional FAT file system.
A host computer 1 comprises a CPU 10, a RAM 20, a ROM 30, an input/output (I/O) interface 40, and a bus 50, being connected to a storage 60 via the I/O interface 40.
The CPU 10 controls the RAM 20, the ROM 30, the I/O interface 40, and the storage 60. The ROM 20 and the RAM 30 are internal storages for running applications; the RAM 20 serves as a work area for the application while the ROM 30 stores such application in advance.
The I/O interface 40 inputs/outputs data to/from the storage 60 or other external devices. The CPU 10, RAM 20, ROM 30, and input/output (I/O) interface 40 are interconnected via the bus 50.
The storage 60 records various items of data in a recording medium, such as a magnetic disc and a magneto-optical disc. The description will now be made on a hard disc drive (HDD) equipped with a magnetic disc.
The CPU 10 executes an application stored in the storage 60 or the ROM 30 to function as a file system 70xe2x80x2. The file system 70xe2x80x2 divides the recording medium, such as an HDD, into unit record areas, or clusters, to which a data sequence is recorded, and stores/manages the data sequence as a file. The FAT is used for managing the clusters, namely, as to which cluster the data is recorded or which cluster is empty (described later in connection with the conventional art of FIG. 16).
The file system 70xe2x80x2 comprises a accessing section 71, a cluster retrieving section 72, a cluster allocating section 73, and an FAT 74.
The cluster allocating section 73 allocates a file (data) to clusters that stores currently no data (hereinafter called xe2x80x9cunallocatedxe2x80x9d). The cluster retrieving section 72 consults with the FAT 74 (described later) to retrieve a particular cluster, namely, a file-stored (hereinafter called xe2x80x9callocatedxe2x80x9d) cluster or an unallocated cluster. The accessing section 71 reads out data from the allocated cluster, which has been retrieved by the cluster retrieving section 72, and writes data to the unallocated cluster, which has been allocated by the cluster allocating section 73.
The FAT 74 manages the clusters of the storage 60, to which clusters a sequence of individual data of a file is allocated. Each entry of the FAT 74 stores also the number of the individual cluster that contains the next part data of the file to manage information about the connection between the allocated clusters in the form of a one-way linked list, thus managing the sequential order of those individual clusters to form the entire file. The FAT 74 manages also unallocated clusters.
With this conventional construction, for reading out data from the recording medium of the storage 60, the cluster retrieving section 72 first consults with the FAT 74 to travel around the individual entries of the FAT 74 one after another until it meets the target cluster that stores desired data, whereupon the accessing section 71 takes access to read out such desired data.
On the other hand, for writing data into the storage 60, the cluster allocating section 73 first activates the cluster retrieving section 72. The cluster retrieving section 72 then consults with the FAT 74 to retrieve an unallocated cluster, whereupon the cluster allocating section 73 allocates data so that the data is written by the accessing section 71.
However, the foregoing conventional file system would encounter the following problems:
(1) The processing, such as fast-forwarding/fast-backwarding of pictures or replaying from a desired picture frame, takes a long time because it requires random access to the recording medium.
For example, in fast-forwarding/fast-backwarding pictures, data has to be read out while jumping forward/backward over the file. Also, the replaying from the desired position requires jumping to the target cluster that stores the desired picture data.
At that time, since the FAT 74 manages information about the connection between the clusters in the form of a one-way link list, the cluster retrieving section 72 must travel around the individual entries of the FAT 74 in a sequential order until it meets the target cluster, which would take a long time to perform the processing. Specifically, if data is read out while fast-backwarding the pictures (jumping backward over the file), the cluster retrieving section 72 needs to travel around the individual entries of the FAT 74 one after another, from the head cluster of the file to a destination cluster, at every backward jumping being performed.
Accordingly, in the processing that requires random access (e.g., jump) to the recording medium, such as fast-forwarding/fast-backwarding of pictures or replaying from a desired picture frame, it would take a rather long time to retrieve a target cluster.
(2) Yet when new picture data is recorded, it still takes a long time to retrieve a cluster that stores no data (unallocated).
The FAT file system 70xe2x80x2 uses the FAT 74 to manage as to whether each cluster is allocated or unallocated with data. Therefore, the cluster retrieving section 72 needs to travel around the individual entries of the FAT 74 one after another to retrieve an unallocated cluster. In particular, if only the trailing part of a single string of the clusters in the recording medium is remained empty (unallocated) the cluster retrieving section 72 needs to travel almost all the individual entries of the FAT 74 from the top until it finds an unallocated cluster, which would take a long time.
(3) Generally, in storages (e.g., HDD), of the type in which data is recorded on a disc-shaped recording medium, such as a magnetic disc or a magneto-optical disc, while the medium is rotating, and in which the Zone Constant Angular Velocity Method is employed to control rotation of the medium, the transfer rate for the inner disc region is slower than that for the outer disc region, thus resulting in a difference in transfer ability. Therefore, there is a fear that the picture data, which can be recorded in a sufficient transfer ability at the outer disc region, might not be recorded at the inner disc region.
As a measure to solve this problem, a picture data recording method is currently known in which data recording starts separately from the inner and outer disc regions toward the midst between them to realize an average transfer rate throughout the entire disc region. In the conventional file system, since the top entry and the bottom entry of the FAT 74 correspond to either the inner end position and the outer end position of the recording medium, respectively, or the outer end position and the inner end position of the recording medium, respectively, data must be allocated by the cluster allocating section 73, separately from the top and bottom entries toward the center of the entry string of the FAT 74.
However, in order to start the data allocating from the bottom entry, the cluster retrieving section 72 needs to travel around the individual entries of the FAT 74 one after another from the top entry, which would take a long time.
(4) In the FAT file system 74xe2x80x2, for recording and replaying picture data of the same file concurrently, namely, for relaying the file being currently recorded, the same file is opened in duplicate, separately one for recording and one for replaying. At that time, since it cannot be recognized from the replay side that a change is made in information about a file size or a location of the head cluster of the continuous cluster string to which the file is allocated, as the result of the updating process at the recording side, it would occasionally be impossible at the replay side to have access to the updated part of the data.
Accordingly, applications which realize a better use of the above-mentioned advantages of the random access media has been cherished in the field of the file system.
With the foregoing problems in view, one object of the present invention is to provide a file system in which a unit record area can be retrieved at high speed during recording/reading of a file stored in recording medium.
Another object of the present invention is to provide a file system in which, even if two or more plural processes are simultaneously performed with respect to the same file, a change occurred in file information as the result of one process can be reflected on another process before execution of the latter process, minimizing the influence of one process on the remaining processes.
In order to attain the above objects, according to a first generic feature of the present invention, there is provided a file system for reading an object file from a recording medium in which one or more files are recorded each in the form of a data sequence, comprising: an accessing section for taking access to the recording medium to read out the object file in terms of unit record areas in the recording medium; a file allocation table for managing address information about the unit record areas in which the object file is recorded; a unit record area retrieving section for retrieving particular one or more set of the unit record areas to which the object file is allocated, by referring the file allocation table; one or more jump tables, provided one for each file, in which each jump table (i) location information about individual data locations from the start of each file and (ii) unit-record-area numbers corresponding to the individual data locations are registered in terms of predetermined distances from the start of each file in the file allocation table; and a jump table retrieving section for retrieving a particular unit-recording-area number from one of the jump tables which corresponds to the object file. When the object file is read from the recording medium, the jump table retrieving section retrieves a unit-record-area number corresponding to the unit record area to which desired individual data of the object file is allocated or a unit-record-area number near desired individual data of the object file, and the unit record area retrieving section retrieves a unit record area containing the desired data by referring the file allocation table based on the unit-record-area number retrieved by the jump table retrieving section, and the accessing section reads out the desired individual data recorded in the unit record area retrieved by the unit record area retrieving section.
Preferably, the file system may further comprise a unit record area allocating section for allocating the data of the individual file to the unallocated unit record areas; the file allocation table manages unallocated unit record areas; and after the unit record area allocating section has allocated the last-named data of the individual file to the unallocated unit record areas, the jump table retrieving section extracts the unit-record-area numbers at the predetermined distances to create the jump table corresponding to the individual file.
As another preferred feature, the file system may further comprise a jump table writing section for writing the jump tables to the recording medium so that the one jump table corresponding to the object file is read from the recording medium when the object file is read out.
As still another preferred feature, the jump table corresponding to the object file may be deleted from the recording medium when the object file is deleted.
As a further preferred feature, the file system may further comprise a jump table checking section for checking whether or not the jump table corresponding to the object file exists so that, if the result of the checking by the jump table checking section is negative, the jump table is created based on the file allocation table.
As a still further preferred feature, the file system may further comprise an updated time checking section for comparing an updated time of the object file and an updated time of the jump table corresponding to the object file so that, if the updated time of the object file is more recent than the updated time of the jump table as the result of the checking, the jump table is updated.
As an additional preferred feature, the file system may further comprise a file checking section for checking whether or not the object file corresponding to the jump table exists so that, if the result of the checking by the file checking section is negative, the jump table is deleted.
According to a second generic feature of the present invention, the file system for writing a data sequence to a recording medium as an object file comprises: an accessing section for taking access to the recording medium to write the object file in terms of unit record areas in the recording medium; a file allocation table for managing address information about the unit record areas in which the object file is recorded; a unit record area retrieving section for retrieving a particular one or more sets of the unit record areas to which the object file is allocated, by referring the file allocation table; a unit record area allocating section for allocating the data of the individual file to the unallocated unit record areas; an unallocated unit record area list in which (i) a unit-record-area number of the start of each of continuous unallocated unit record areas of different isolated sets in the recording medium and (ii) the number of the continuous unallocated unit record areas of each set, succeeding from the starting unallocated unit record area, are registered in correlation with one another and in which (iii) relation information symmetrically liking such information registered for each set with that registered for other sets is registered; and an unallocated unit record area list retrieving section for retrieving an isolated set of continuous unallocated unit record areas by referring the unallocated unit record area list. When the object file is written to the recording medium, the unallocated unit recording area retrieving section retrieves the unallocated unit record area; the unit recording area allocating section allocates individual data of the object file to the unallocated record areas retrieved by the unallocated unit recording area retrieving section, and unit record areas to which individual data of the object file is allocated are deleted from the unallocated unit record area list.
According to a third generic feature of the present invention, the file system for writing a sequence of data to a recording medium as an object file and reading the object file from the recording medium comprises: an accessing section for taking access to the recording medium to write/read the object file in terms of unit record areas in the recording medium; a file allocation table for managing address information about the unit record areas in which the object file is recorded; a unit record area retrieving section for retrieving particular one or more sets of the unit record areas to which the object file is allocated, by referring the file allocation table; one or more jump tables, provided one for each file, in which each jump table (i) location information about individual data locations from the start of each file and (ii) unit-record-area numbers corresponding to the individual data locations are registered in terms of predetermined distances from the start of each file in the file allocation table; a jump table retrieving section for retrieving a particular unit-recording-area number from one of the jump tables which corresponds to the object file; a unit record area allocating section for allocating the data of the individual file to the unallocated unit record areas; an unallocated unit record area list in which (i) a unit-record-area number of the start of each of continuous unallocated unit record areas of different isolated sets in the recording medium and (ii) the number of the continuous unallocated unit record areas of each set, succeeding from the starting unallocated unit record area, are registered in association with one another and in which (iii) relation information symmetrically liking such information registered for each set with that registered for other sets is registered; and an unallocated unit record area list retrieving section for retrieving an isolated set of continuous unallocated unit record areas by referring the unallocated unit record area list. When the object file is written to the recording medium, the unallocated unit recording area retrieving section retrieves the unallocated unit record area, and the unit recording area allocating section allocates individual data of the object file to the unallocated record areas retrieved by the unallocated unit recording area retrieving section, and unit record areas to which individual data of the object file is allocated are deleted from the unallocated unit record area list. When the object file is read from the recording medium, the jump table retrieving section retrieves a unit-record-area number corresponding to the unit record area to which desired individual data of the object file is allocated or a unit-record-area number near desired individual data of the object file, and the unit record area retrieving section retrieves a unit record area containing the desired data by referring the file allocation table based on the unit-record-area number retrieved by the jump table retrieving section; and the accessing section reads out the desired individual data recorded in the unit record area retrieved by the unit record area retrieving section.
Preferably, the unallocated unit record area list may be created when a power switch is turned on or the recording medium is inserted. As another preferred feature, information about unit recording areas having newly become unallocated when the object file is deleted may be added to the unallocated unit record area list.
As still another preferred feature, the unallocated unit record area list may be recorded in the recording medium when a power switch is turned off or the recording medium is ejected, and also the unallocated unit record area list may be read from the recording medium when the power switch is turned on or the recording medium is inserted.
As a further preferred feature, the file system may further comprise: a file list writing section for writing a file list, in which file names of the files recorded in the recording medium and times of creation of the recorded files are registered in association with one another, when the power switch is turned off or the recording medium is ejected; and a file list comparing section for comparing content of the file list written in the recording medium with the files actually recorded in the recording medium, so that if the content of the file list written in the recording medium is different from the files actually recorded in the recording medium as the result of the comparing, the unallocated unit record area list is updated, based on information about the actually recorded files, when the power switch is turned on or the recording medium is inserted.
As a still further preferred feature, the file system may further comprise a file information duplicating section for duplicating file information over various processes for one and the same file prior to such processing of the last-named file.
With the file system of the present invention, it is possible to guarantee the following advantageous results:
(1) In reading an object file from the recording medium, since the jump table retrieving section retrieves a unit-record-area number corresponding to the unit record area to which desired individual data of the object file is allocated or a unit-record-area number near the desired individual data of the object file, it is possible to retrieve desired data at high speed, particularly during retrieving in the descending order of the unit-record-are numbers.
(2) It is possible to create a jump table consistent with actual unallocated unit record areas.
(3) Since a jump table, which has been recorded in the recording medium, is readout from the recording medium at the read-out of the file, it is unnecessary to create the jump table at each read-out of the file, thus speeding up the processing.
(4) Effective use of the recording medium can be achieved.
(5) After searching for a jump table corresponding to the object file, if it is judged that no such jump table is present, the jump table is created based on the FAT. As the result, the jump table corresponding to the object file is provided so that a unit record area can be retrieved at high speed.
(6) An updated time of the object file and an updated time of the corresponding jump table are compared. If the updated time of the object file is more recent than that of the jump table, then the jump table is updated to make the file consistent with the jump table all the time, thus improving the reliability.
(7) In writing the object file to the recording medium, an unallocated unit record area is retrieved based on an unallocated unit record area list so that the unallocated unit record area can be retrieved at high speed.
(8) Partly since the unallocated unit record area list is written to the recording medium when a power switch is turned off or the recording medium is ejected, and partly since the unallocated unit record area list is read out from the recording medium when the power switch is turned on or the recording medium is inserted, it is unnecessary to create the unallocated unit record area list at each read-out of the file after turning-off of the power switch or ejecting of the recording medium. This speeds up the processing.
(9) Since the file stored in the recording medium is made consistent with the unallocated unit record area list every time the power switch is turned on or the recording medium is inserted, an increased degree of reliability can be guaranteed.
(10) If two or more processes are simultaneously performed with respect to the same file, file information is duplicated over the individual processes for the same file prior to execution of the processing. A change occurred in the file information due to one process can thus be reflected on another process prior to execution of the latter process, minimizing the influence of one process upon the remaining individual processes.
Other objects and further features of the present invention will be apparent from the following detailed description when read in conjunction with the accompanying drawings.